<template>
  <div class="home">

    <h2>home</h2>
    <div class="item" v-for="item in list">
      <h4>{{item.corpName}}</h4>
      <p>{{item.corpCreditCode}}</p>
    </div>
  </div>
</template>

<script lang="ts">
interface queryConfig {
  colType: string;
  corpName: string;
  domainId?: any;
  qualType: string;
  current: number;
  size: number;
}
import { defineComponent, onMounted, ref , reactive  } from 'vue';
import { searchApi } from "/@/api/home";
export default defineComponent({
  name: 'home',
  components: {},
  setup() {
    const list = ref<any>({});

    let queryParam = reactive<queryConfig>({
      colType: "1",
      corpName: "",
      qualType: "QY_TYPE_SG",
      current: 1,
      size: 10
    })

    const getSearchApi = async () => {  //判断有没有紧急通知
      let data = await searchApi(queryParam);
      let { total , records  } = data;
      if(total) {
        list.value = records;
      }
    };

    const init = () => {
      getSearchApi()
    }

    onMounted(init);

    return {
      list
    }
  }
})
</script>

<style lang="scss" scoped>
.home{
  padding-top: 10px;
  text-align: center;

  .item{
    margin: 10px;
    padding: 10px;
    border: 1px solid #ddd;
  }
}

</style>

